<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../vue.js"></script>
</head>

<body>
  <div id="app">
    <h2 v-if="scort>=90">优秀</h2>
    <h2 v-else-if="scort>=80">良好</h2>
    <h2 v-else-if="scort>=60">及格</h2>
    <h2 v-else>不及格</h2>
    <!-- 如果进行复杂的判断的话 不会像上面那样写 而是将判断条件写在computed中 -->
    <h1>{{result}}</h1>
  </div>
  <script>
    const app = new Vue({
      el: "#app",
      data: {
        scort: 55,
      },
      computed: {
        result() {
          let showMeassage = "";
          if (this.scort >= 90) {
            showMeassage = "优秀";
          } else if (this.scort >= 80) {
            showMeassage = "良好";
          } else if (this.scort >= 60) {
            showMeassage = "及格";
          } else {
            showMeassage = "不及格"
          }
          return showMeassage;
        }
      }
    })
  </script>
</body>

</html>